<?php
	
	$save_path ='E:/wamp/www/my-qy-project/upload/company/';
	$upload_name = "Filedata";
	$max_file_size_in_bytes = 1147483;
	$extension_whitelist = array("jpeg", "jpg", "gif", "png");	//允许的文件
	$valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-';	        //允许的文件名字符
	$file_name = preg_replace('/[^'.$valid_chars_regex.']|\.+$/i', "", basename($_FILES[$upload_name]['name']));
	$extname = strtolower(substr($file_name, strrpos($file_name, '.') + 1));
	$file_name =mktime().rand(100, 999).'.'.$extname;
	$file_name = mktime().$file_name;
	if (!@move_uploaded_file($_FILES[$upload_name]["tmp_name"], $save_path.$file_name)){
			exit(0);
	}else{
	}
	echo $file_name;


?>
